﻿<%@ Page Title="Category Master" Language="C#" MasterPageFile="~/GEMS.master" AutoEventWireup="true"
    CodeFile="CategoryMaster.aspx.cs" Inherits="CategoryMaster" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <script language="javascript" type="text/javascript">
    function validate() {
        var Show = '';
        if (document.getElementById("<%=txtcatcode.ClientID %>").value == "") {
            Show = Show + '\n - Enter Category Code';
        }

        if (document.getElementById("<%=txtCattype.ClientID %>").value == "") {
            Show = Show + '\n - Enter Category Type';
        }
        if (document.getElementById("<%=txtcatname.ClientID %>").value == "") {
            Show = Show + '\n - Enter Category Name';
        }
       
        if (Show != '') {
            alert(Show);
            return false;
        }
        else {
            return true;
        }
    }

    </script>
    <style type="text/css">
        .header
        {
            font-weight: bold;
            position: absolute;
            background-color: White;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <div class="container960">
        <div class="container_12 container_16">
            <div class="full">
                <div class="content">
                    <h2>
                        Category Master</h2>
                    <div class="f_head r2 box">
                        <div class="head_con">
                            <div class="c1">
                                <div class="rw1">
                                    <asp:Label ID="lblCode" runat="server" CssClass="text" Text="Category Code"></asp:Label>
                                    <asp:TextBox ID="txtcatcode" runat="server" CssClass="text_field field"></asp:TextBox>
                                </div>
                                <div class="rw1 ">
                                    <span class="text">Category Type</span>
                                    <asp:TextBox ID="txtCattype" runat="server" CssClass="text_field field"></asp:TextBox>
                                </div>
                            </div>
                            <div class="c2">
                                <div class="rw1">
                                    <span class="text">Category Name</span>
                                    <asp:TextBox ID="txtcatname" runat="server" CssClass="text_field field"></asp:TextBox>
                                </div>
                                <div class="rw1 last_btn">
                                    <span class="text">&nbsp;</span>
                                    <asp:Button ID="btnsave" runat="server" Text="Add" class="lgin" OnClick="btnsave_Click"
                                        OnClientClick=" return validate();" />
                                    <div class="grid_2">
                                        &nbsp;</div>
                                    <asp:Button ID="btnclear" runat="server" Text="Clear" class="lgin" OnClick="btnclear_Click" />
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="box" id="count_grid">
                        <div class="grid1">
                            <asp:GridView ID="GridView1" runat="server" BackColor="White" CssClass="mGrid" GridLines="Vertical"
                                DataKeyNames="Category_ID" AutoGenerateColumns="False" OnSorting="gvList_Sorting" AllowSorting="true"
                                OnRowDataBound="grdiview_RowDataBound">
                                <Columns>
                                    <asp:TemplateField HeaderText="Edit">
                                        <ItemTemplate>
                                            <asp:ImageButton ID="Ibtedt" runat="server" CausesValidation="False" ImageUrl="~/css/images/edit.jpg"
                                                Text="Edit" ToolTip="Click here to Edit" OnClick="ibtEdit_Click" />
                                        </ItemTemplate>
                                        <ItemStyle  HorizontalAlign="Center" />
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Delete">
                                        <ItemTemplate>
                                            <asp:ImageButton ID="ibtdlt" runat="server" CausesValidation="False" ImageUrl="~/css/images/delete.gif"
                                                OnClick="ibtDelete_Click" Text="Delete" ToolTip="Click here to Delete" OnClientClick="return confirm('Are you sure to delete ?');" />
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:BoundField HeaderText="Code" DataField="Code" SortExpression="Code" />
                                    <asp:BoundField HeaderText="Name" DataField="Name" SortExpression="Name" />
                                    <asp:BoundField HeaderText="Type" DataField="Type" SortExpression="Type" />
                                </Columns>
                              
                            </asp:GridView>
                        </div>
                        <uc1:Pager ID="PagerControl" runat="server" />
                    </div>
                </div>
            </div>
        </div>
    </div>
</asp:Content>
